package com.jiyun.mapper;

import com.jiyun.entity.Goods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 聪哥哥
 * @since 2023-06-06
 */
public interface GoodsMapper extends BaseMapper<Goods> {

    @Select("SELECT g.name x,SUM(a.num) y FROM  tb_apply a,tb_goods g WHERE a.gid=g.id GROUP BY gid")
    List<Map> selectZhu();

    @Select("SELECT u.username name,SUM(a.num) value FROM  tb_apply a,tb_user u WHERE a.uid=u.id GROUP BY uid")
    List<Map> selectBing();
}
